﻿
namespace Jet.Utilities.Tests
{
	internal class DisposableResourceMoc : DisposableResource
	{
		public bool PublicDisposed { get { return Disposed; } }
		public bool DisposedFromGC { get; private set; }
		public bool DisposeResourceCalled { get; set; }

		public static bool InstanceDisposed { get; set; }
		public static bool DisposedFromGCStatic { get; set; }

		public DisposableResourceMoc()
		{
			DisposeResourceCalled = false;
		}

		protected override void DisposeResources(bool disposeManagedResources)
		{
			DisposedFromGC = !disposeManagedResources;
			DisposedFromGCStatic = DisposedFromGC;
			DisposeResourceCalled = true;
		}

		~DisposableResourceMoc()
		{
			InstanceDisposed = true;
		}

	}

}
